


************
*County-level analysis for ``Learning to Love Government? Technological Change and the Political Economy of Higher Education''
******Journal of Politics

*************Below is the code for reproducing the analyses on income outcomes, Tables C1-C11, C13

///Install packages
clear
ssc install maptile, replace
//maptile_install using "http://files.michaelstepner.com/geo_county1990.zip"
ssc install sutex, replace
ssc install estout, replace
ssc install ivreg2, replace
set scheme s2color, permanently


///make the US county data
///Starting with home directory Learning to love JOP data/

//If needed  cd ../..
//If needed  cd "~/Learning to love JOP data/"
cd "Data"

////Start with investment in Higher education
use "HEinvestmentdata.dta"

////Merge with USCounty Exposure

merge 1:1 countyfips year using "USCountyExposure.dta", gen(_exposure)

////Merge with USCounty Covariates

merge 1:1 countyfips year using "USCountyCovariates.dta", gen(_covariates)

save "USCountyData.dta", replace


///set working directory

cd ..

cd "Output/2Countyanalysis"

log using "2Log.smcl", replace


 
/////////////
///////control variables interacted for different levels with period for initial periods
////////////

global countycontrolsraceinyear l_sh_popedu_c90 l_sh_popedu_c00 l_sh_popedu_c10 l_shind_manuf_cbp90 l_shind_manuf_cbp00 l_shind_manuf_cbp10 l_sh_popfborn90 l_sh_popfborn00 l_sh_popfborn10 l_sh_empl_f90 l_sh_empl_f00 l_sh_empl_f10 White_90 White_00 White_10 Black_90 Black_00 Black_10 popdensity90 popdensity00 popdensity10  year2000 year2010 


////// Table C.1: Technological change, higher education investments, and decadal change in per capita income 


	eststo clear

quietly reg  d10_pcincome2000   c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a      $countycontrolsraceinyear  reg_*  [aw=natpopshareimp]  if cycle10year==1, cluster(czone)
 eststo	
 
 //Figure B.2: OLS estimates: Marginal effects of a change (percent 0-1) in routine share of employment by level of investment in higher education on income.
 quietly margins , dydx(l_sh_routine33a) at(logtotalrev90imp=(0(.5)8)) vsquish

 marginsplot , graphregion(color(white)) yline(0) xtitle("Log HE investment p.c. 1990")	ytitle("")	title("")	
	
	graph export Income_OLSroutine.pdf, replace 

 
quietly ivreg2  d10_pcincome2000   (l_sh_routine33a c.l_sh_routine33a#c.logtotalrev90imp=R33a_1950 c.R33a_1950#c.logtotalrev90imp) logtotalrev90imp       $countycontrolsraceinyear  reg_*  [aw=natpopshareimp]  if cycle10year==1, cluster(czone)
 eststo	
 
 	esttab est1 est2   using "Econ1990Income.tex", drop(_cons $countycontrolsraceinyear  reg_*) order(c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a)   interaction(" $\times$ ") style(tex) replace label se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) nonotes
 
 ///Figure 2 IV estimates: Marginal effects of differences in routine employment share on economic outcomes, by level of investment in higher education.
 
 
quietly margins , dydx(l_sh_routine33a) at(logtotalrev90imp=(0(.5)8)) vsquish

 marginsplot , graphregion(color(white)) yline(0) xtitle("Log HE investment p.c. 1990")	ytitle("")	title("")	
	
	graph export Income_IV1950sroutine.pdf, replace 


	
///Table C.2 Technological change, higher education investments, and decadal change in per capita income, exploiting the number of HE institutions per county in 1950



	eststo clear


	ivreg2  d10_pcincome2000  (logtotalrev90imp c.l_sh_routine33a#c.logtotalrev90imp= c.l_sh_routine33a#c.countyinst100nottier1 countyinst100nottier1)  l_sh_routine33a      $countycontrolsraceinyear  reg_*    if cycle10year==1, cluster(czone)
	 eststo
 
esttab  est1  using "1990HEinst1950s.tex", replace label se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
drop(_cons $countycontrolsraceinyear  reg_*) order(c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a)   interaction(" $\times$ ") style(tex)    nonotes	

	
	
	 
////Table C.3 Summary statistics of different measures of county higher education investment per in 1990, by type of institution

sutex totalrev3allperpop totalrev90nt1  totalrevtier1perpop totalrevccpublic90perpop if year==1990, labels minmax digits(2) file(SummaryInstitutions.tex) replace

 
 
 

//Table C.4 Technological change, higher education investments in different subsets of higher education institutions, and real per capita income–OLS Estimates

 
eststo clear	 
	 foreach var in  logtotalrevall90imp logtotalrevtier190imp  logtotalrevccpublic90imp  {

quietly reg  d10_pcincome2000  c.l_sh_routine33a#c.`var' `var'       $countycontrolsraceinyear l_sh_routine33a reg_*  [aw=natpopshareimp]  if cycle10year==1, cluster(czone)
 eststo	
 	 
}

  
  esttab  using "OLSEcon1990Bytypes.tex", replace label se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
drop(_cons $countycontrolsraceinyear  reg_*) order(c.l_sh_routine33a#c.logtotalrevall90imp logtotalrevall90imp c.l_sh_routine33a#c.logtotalrevtier190imp logtotalrevtier190imp c.l_sh_routine33a#c.logtotalrevccpublic90imp logtotalrevccpublic90imp l_sh_routine33a) interaction(" $\times$ ") style(tex)    nonotes


//Table C.5 Technological change, higher education investments in different subsets of higher education institutions, and real per capita income–IV Estimates


eststo clear



foreach var in  logtotalrevall90imp logtotalrevtier190imp  logtotalrevccpublic90imp  {

quietly ivreg2  d10_pcincome2000   (l_sh_routine33a c.l_sh_routine33a#c.`var'=R33a_1950 c.R33a_1950#c.`var') `var'       $countycontrolsraceinyear  reg_*  [aw=natpopshareimp]  if cycle10year==1, cluster(czone)
 eststo	
 	 
}


esttab est1 est2  est3 using "IVEcon1990Bytypes.tex", replace label se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
drop(_cons $countycontrolsraceinyear  reg_*)  order(c.l_sh_routine33a#c.logtotalrevall90imp logtotalrevall90imp c.l_sh_routine33a#c.logtotalrevtier190imp logtotalrevtier190imp c.l_sh_routine33a#c.logtotalrevccpublic90imp logtotalrevccpublic90imp l_sh_routine33a) interaction(" $\times$ ") style(tex)  nonotes



	
////Table C.6 Technological change, higher education investments, and decadal change in per capita income: low and high manufacturing share counties
sum l_shind_manuf_cbp if year==1990, detail ///median is 17.40733

gen highmanufac=0 if l_shind_manuf_cbp< 17.40773
replace highmanufac=1 if l_shind_manuf_cbp>= 17.40773

 
//Panel A: OLS models
	eststo clear

quietly reg  d10_pcincome2000   c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a      $countycontrolsraceinyear  reg_*  [aw=natpopshareimp]  if cycle10year==1 & highmanufac==0, cluster(czone)
 eststo	

 quietly reg  d10_pcincome2000   c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a      $countycontrolsraceinyear  reg_*  [aw=natpopshareimp]  if cycle10year==1 & highmanufac==1, cluster(czone)
 eststo	
 
 	esttab est1 est2   using "Econ1990IncomeHighLowmanuf.tex", replace label se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
drop(_cons $countycontrolsraceinyear  reg_*) order(c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a) interaction(" $\times$ ") style(tex)  nonotes

 
 //Panel B: IV models
 	eststo clear
 
quietly ivreg2  d10_pcincome2000   (l_sh_routine33a c.l_sh_routine33a#c.logtotalrev90imp=R33a_1950 c.R33a_1950#c.logtotalrev90imp) logtotalrev90imp       $countycontrolsraceinyear  reg_*  [aw=natpopshareimp]  if cycle10year==1 & highmanufac==0, cluster(czone)
 eststo	

 quietly ivreg2  d10_pcincome2000   (l_sh_routine33a c.l_sh_routine33a#c.logtotalrev90imp=R33a_1950 c.R33a_1950#c.logtotalrev90imp) logtotalrev90imp       $countycontrolsraceinyear  reg_*  [aw=natpopshareimp]  if cycle10year==1 & highmanufac==1, cluster(czone)
 eststo	
 
 
	esttab est1 est2   using "IVEcon1990IncomeHighLowmanuf.tex", drop(_cons $countycontrolsraceinyear  reg_*) order(c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a)  interaction(" $\times$ ") style(tex)  replace label se star(+ 0.1 * 0.05 ** 0.01 *** 0.001)   nonotes

	
	drop highmanufac
	
	
	
	

 
//Table C.7: Technological change, higher education investments, and decadal change in per capita income, extensive and intensive marginsT



 gen positiverev90=1 if logtotalrev90imp>0
  replace positiverev90=0 if logtotalrev90imp<=0

  label variable positiverev90 "Some HE Investment 1990"

//Panel A: Districts with some investment vs none in 1990 (extensive margin)
	eststo clear

quietly reg  d10_pcincome2000   c.l_sh_routine33a#i.positiverev90 positiverev90 l_sh_routine33a      $countycontrolsraceinyear  reg_*  [aw=natpopshareimp]  if cycle10year==1 , cluster(czone)
 eststo	
 
 
quietly ivreg2  d10_pcincome2000   (l_sh_routine33a c.l_sh_routine33a##i.positiverev90=  R33a_1950 c.R33a_1950##i.positiverev90) positiverev90       $countycontrolsraceinyear  reg_*  [aw=natpopshareimp]  if cycle10year==1 , cluster(czone)
 eststo	
 

	esttab est1 est2   using "Econ1990IncomeExtensivemargin.tex", replace label se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) drop(_cons $countycontrolsraceinyear  reg_*) order( positiverev90 l_sh_routine33a) interaction(" $\times$ ") style(tex)  nonotes

////// Panel B: Only districts with some investment in 1990 (intensive margin)

	eststo clear

quietly reg  d10_pcincome2000   c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a      $countycontrolsraceinyear  reg_*  [aw=natpopshareimp]  if cycle10year==1 & logtotalrev90imp>0, cluster(czone)
 eststo	
 
quietly ivreg2  d10_pcincome2000   (l_sh_routine33a c.l_sh_routine33a#c.logtotalrev90imp=R33a_1950 c.R33a_1950#c.logtotalrev90imp) logtotalrev90imp       $countycontrolsraceinyear  reg_*  [aw=natpopshareimp]  if cycle10year==1 & logtotalrev90imp>0, cluster(czone)
 eststo	
 
	esttab est1 est2   using "Econ1990IntensiveRestrict.tex", replace label se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
drop(_cons $countycontrolsraceinyear  reg_*) order(c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a) interaction(" $\times$ ") style(tex)  


drop positiverev90	





/////Table C.8: Technological change, higher education investments, and decadal change in per capita income. No weights


	eststo clear

quietly reg  d10_pcincome2000   c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a      $countycontrolsraceinyear  reg_*   if cycle10year==1, cluster(czone)
 eststo	
 

 
quietly ivreg2  d10_pcincome2000   (l_sh_routine33a c.l_sh_routine33a#c.logtotalrev90imp=R33a_1950 c.R33a_1950#c.logtotalrev90imp) logtotalrev90imp       $countycontrolsraceinyear  reg_*    if cycle10year==1, cluster(czone)
 eststo	
 
esttab est1 est2   using "Econ1990IncomeNoWeights.tex", replace label se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
drop(_cons $countycontrolsraceinyear  reg_*) order(c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a) interaction(" $\times$ ") style(tex)  



 //////////////////////
//Table C.9: Technological Change, Higher Education Investments in different subsets of higher education, and real per capita Income–OLS Estimates. No weights


eststo clear

foreach var in  logtotalrevall90imp logtotalrevtier190imp  logtotalrevccpublic90imp {

quietly reg  d10_pcincome2000   c.l_sh_routine33a#c.`var' `var' l_sh_routine33a      $countycontrolsraceinyear  reg_*    if cycle10year==1, cluster(countyfips)

eststo
}

esttab est1 est2 est3  using "OLSEcon1990subsetsNoweights.tex", replace label se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
drop(_cons $countycontrolsraceinyear  reg_*) order(c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a) interaction(" $\times$ ") style(tex)  
 
	
	
 //////////////////////
//Table C.10: Technological Change, Higher Education Investments in different subsets of higher education, and real per capita Income–IV Estimates	 No weights
	
	eststo clear

foreach var in  logtotalrevall90imp logtotalrevtier190imp  logtotalrevccpublic90imp  {

quietly ivreg2  d10_pcincome2000   (l_sh_routine33a c.l_sh_routine33a#c.`var'=R33a_1950 c.R33a_1950#c.`var') `var'       $countycontrolsraceinyear  reg_*  if cycle10year==1, cluster(czone)
 eststo	
 	 
}


esttab est1 est2  est3 using "IVEcon1990alternativesubsetsNoweights.tex", replace label se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
drop(_cons $countycontrolsraceinyear  reg_*) order(c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a)		 interaction(" $\times$ ") style(tex)  
 
 
	

///Table C.11: Technological change, higher education investments, and county characteristics




eststo clear
quietly reg  l_sh_popedu_c   c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a         l_shind_manuf_cbp  l_sh_popfborn     White_  popdensity  populationover16  [aw=natpopshareimp]  if year==2015, cluster(czone)
 eststo	
 
quietly reg  l_shind_manuf_cbp   c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a        l_sh_popedu_c   l_sh_popfborn     White_  popdensity  populationover16  [aw=natpopshareimp]  if year==2015 , cluster(czone)
 eststo	

 
 quietly reg  l_sh_popfborn   c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a        l_sh_popedu_c l_shind_manuf_cbp       White_  popdensity  populationover16  [aw=natpopshareimp]  if year==2015 , cluster(czone)
 eststo	
 
 quietly reg  White_   c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a        l_sh_popedu_c l_shind_manuf_cbp  l_sh_popfborn       popdensity  populationover16  [aw=natpopshareimp]   if year==2015, cluster(czone)
 eststo	
 
 
  quietly reg  popdensity   c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a        l_sh_popedu_c l_shind_manuf_cbp  l_sh_popfborn   White_      populationover16  [aw=natpopshareimp]  if year==2015 , cluster(czone)
 eststo	
 
  quietly reg presdemshare5year    c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a        l_sh_popedu_c l_shind_manuf_cbp  l_sh_popfborn   White_    popdensity    [aw=natpopshareimp]  if year==2015 , cluster(czone)
 eststo	
 

 
 
esttab using RegressingCovariates.tex , replace label se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
drop(_cons l_sh_popedu_c  popdensity     l_sh_popedu_c l_shind_manuf_cbp  l_sh_popfborn   White_    popdensity _cons)  order(c.l_sh_routine33a#c.logtotalrev90imp logtotalrev90imp l_sh_routine33a)   interaction(" $\times$ ") style(tex)    nonotes





////////////Table C.13 Summary statistics for county variables
 gen sharecollege=l_sh_popedu_c/100
  gen sharemanufacturingempl=l_shind_manuf_cbp/100
  gen sharepopforeignborn=l_sh_popfborn/100
  gen femaleemplrate=l_sh_empl_f/100
  
  
  label var sharecollege "Share college educated"
  label var sharemanufacturingempl "Share manufacturing empl."
  label var sharepopforeignborn "Share pop. foreign born"
  label var femaleemplrate "Female employment rate"




   sutex d10_pcincome2000 l_sh_routine33a R33a_1950 logtotalrev90imp sharecollege sharemanufacturingempl sharepopforeignborn femaleemplrate White_  Black_ popdensity if cycle10year==1 , label minmax nobs file(SummarystatsCounty.tex) replace
  ///For summary statistics Cal. Sample, see its own code 
  
drop sharecollege
  drop sharemanufacturingempl
  drop sharepopforeignborn
  drop femaleemplrate
  

  
 
  
  
 
 
 //////Appendix D: Data Appendix for economic effect analysis

 
 
 //maps and histograms

	
///Figure D.1 a, US Histogram
	
		hist l_sh_routine33a if year==2000, freq  below start(0)  legend(off) ///
		graphregion(color(white))
	

graph export "UShistogramRoutine.png"


///Figure D.1 b, California Histogram

hist l_sh_routine33a if statefips==6 & year==2015, freq  below start(0) width(.02) legend(off)  ///
	graphregion(color(white)) 
	
	graph export "CalhistogramRoutine.png"

///Figure D.1 c, US map


	maptile l_sh_routine33a if  year==2000, geo(county1990)  geofolder("maptile")

graph export "USmapRoutine.png"


///Figure D.1 d, California Map

maptile l_sh_routine33a if statefips==6 & year==2015, geo(county1990) mapif(statefips==6)   twopt(legend(pos(1)))  geofolder("maptile")



graph export "CalmapRoutine.png"



///Figure D.2 a, US Histogram
hist logtotalrev90imp if year==2000, freq  below start(0) width(1) legend(off) xlabel(0(1)10) ///
	graphregion(color(white)) 
	
	
	graph export UShistogramInvestment.png, replace

///Figure D.2 b, US Histogram
hist logtotalrev90imp if statefips==6 & year==2015, freq  below start(0) width(1) legend(off) xlabel(0(1)10) ///
	graphregion(color(white)) 
	
	
	graph export "CalhistogramInvestment.png"

	///Figure D.2 c, US Map
	maptile logtotalrev90imp if  year==2000, geo(county1990) geofolder("maptile")
	
		graph export "USMapInvestment.png", replace
	
///Figure D.2 d, California Map

maptile logtotalrev90imp if statefips==6 & year==2015, geo(county1990) mapif(statefips==6)  twopt(legend(pos(1))) geofolder("maptile")


		graph export "CalMapInvestment.png"

		

		
	log close
		
